package com.example.service.impl;

import com.example.mapper.SpuMapper;
import com.example.entity.SecKillSpu;
import com.example.service.SpuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

/**
 * (SecKillSpu)表服务实现类
 *
 * @author 游家纨绔
 * @since 2023-08-30 12:30:00
 */
@Service("spuService")
public class SpuServiceImpl implements SpuService {

	@Autowired
	private SpuMapper spuMapper;

	@Override
	public SecKillSpu selectOne(Integer spuId) {
		Example example = new Example(SecKillSpu.class);
		example.createCriteria().andEqualTo("id", spuId);
		return spuMapper.selectOneByExample(example);
	}

	@Override
	public SecKillSpu selectById(Integer spuId) {
		return spuMapper.selectByPrimaryKey(spuId);
	}

}
